/*
 * Copyright Wayne Motycka 2011.
 * Released under GPLv3 for public use
 */

package carshow;

import java.io.Serializable;

/**
 * EntrantData is a container class to encapsulate
 * a single Entrants record from the database when a SQL 'select' is done
 * An array of these data structures is used to transport the response from
 * the SQLShowDB database file in SQLite.
 *
 * @author Wayne Motycka
 * @version 0.1
 * April 6, 2011
 *
 */
public class EntrantData implements Serializable {
    /**
     * public variables so you can directly access them when wanted but with
     * care because you can violate the validity.  The only one that should
     * be left open is EntrantNumber.
     */
    private static final long serialVersionUID = 1L;
    private int EntrantNumber;
    private int Year;
    private String FirstName;
    private String LastName;
    private String Address;
    private String City;
    private String State;
    private String Zip;
    private String entryClass;
    private String Make;
    private String Model;
    private String Color;
    private String Parking;
    private String Club;
    private int pre_reg;

    public EntrantData() {
        FirstName = null;
        LastName = null;
        entryClass = null;
        Address = null;
        City = null;
        State = null;
        Zip = null;
        EntrantNumber = -1;
        Make = null;
        Model = null;
        Color = null;
        Year = -1;
        Parking = null;
        Club = null;
        pre_reg = -1;
    }

    public EntrantData(String firstName, String lastName, String mnem, 
            String address, String city, String state, String zip,
            String phone, int entry, String make, String model,
            String color, int year, String parking, String club, int preg) {
        // this does a deep copy style setup to ensure this
        // keeps data to itself.  It may be overkill but data
        // paranoia is just good thinking in the JVM.
        FirstName = firstName;
        LastName = lastName;
        entryClass = mnem;
        Address = address;
        City = city;
        State = state;
        Zip = zip;
        EntrantNumber = entry;
        Make = make;
        Model = model;
        Year = year;
        Color = color;
        Parking = parking;
        Club = club;
        pre_reg = preg;
    }
    public EntrantData(EntrantData ed) {
        this.EntrantNumber = ed.EntrantNumber;
        this.Year = ed.Year;
        this.Address = new String(ed.Address);
        this.City = new String(ed.City);
        this.Club = new String(ed.Club);
        this.Color = new String(ed.Color);
        this.FirstName = new String(ed.FirstName);
        this.LastName = new String(ed.LastName);
        this.Make = new String(ed.Make);
        this.Model = new String(ed.Model);
        this.State = new String(ed.State);
        this.Zip = new String(ed.Zip);
        this.entryClass = new String(ed.entryClass);
        this.Parking = new String(ed.Parking);
        this.pre_reg = ed.pre_reg;
    }

    public String getFirstName() {
        return this.FirstName;
    }
    public void setFirstName(String newfname) {
        this.FirstName = new String(newfname);
    }
    public String getLastName() {
        return this.LastName;
    }
    public void setLastName(String newlname) {
        this.LastName = new String(newlname);
    }
    public String getAddress() {
        return this.Address;
    }
    public void setAddress(String newaddr) {
        this.Address = new String(newaddr);
    }
    public String City() {
      return this.City;
    }
    public void setCity(String newcity) {
        this.City = new String(newcity);
    }
    public String getState() {
    return this.State;
    }
    public void setState(String newstate) {
        this.State = new String(newstate);
    }
    public String getZip() {
    return this.Zip;
    }
    public void setZip(String newzip) {
        this.Zip = new String(newzip);
    }
    public int getEntrantNum() {
     return this.EntrantNumber;
    }
    public void setEntrantNum(int newnum) {
        this.EntrantNumber = newnum;
    }
    public String getEntryClass() {
    return this.entryClass;
    }
    public void setEntryClass(String newclass) {
        this.entryClass = new String(newclass);
    }
    public String getMake() {
      return this.Make;
    }
    public void setMake(String newmake) {
        this.Make = new String(newmake);
    }
    public String getModel() {
      return this.Model;
    }
    public void setModel(String newmodel) {
        this.Model = new String(newmodel);
    }
    public void setColor(String color) {
        this.Color = color;
    }
    public String getColor() {
        return this.Color;
    }
    public Integer getYear() {
      return this.Year;
    }
    public void setYear(Integer newyear) {
        this.Year = new Integer(newyear);
    }
    public String getParking() {
        return this.Parking;
    }
    public void setParking(String parking) {
        this.Parking = new String(parking);
    }
    public void setClub(String club) {
        this.Club = club;
    }
    public String getClub() {
        return this.Club;
    }
    public int getPreReg() {
        return pre_reg;
    }
    @Override
    public EntrantData clone() {
        EntrantData ed = new EntrantData(this);
        return ed;
    }
}
